package org.demo.utils;

import java.util.HashMap;

public class Config {
	
	private HashMap<String, String> mConfig;
	private String mConfigPath;
		
	public static final String KEY_QSAHARASERVER = "QSaharaServer";
	public static final String KEY_FIREHOSELOADER = "fh_loader";
	public static final String KEY_COM_PORT = "COMPort";
	public static final String KEY_PROGRAMMER_PATH = "ProgrammerPath";
	public static final String KEY_SEARCH_PATH = "SearchPath";
	public static final String KEY_OUTPUT_PATH = "OutputPath";
	public static final String KEY_RAWPROGRAMM_PATH = "RawprogramPath";
	public static final String KEY_DEVICE_TYPE = "DeviceType";
	public static final String KEY_USE_VERBOSE = "UseVerbose";
	public static final String KEY_RESET_AFTER_DOWNLOAD = "ResetAfterDownload";
	public static final String KEY_EARSE_ALL_BEFORE_DOWNLOAD = "EarseAllBeforeDownload";
	
	public static final String DEFAULT_QSAHARASERVER = "C:\\Program Files (x86)\\Qualcomm\\QPST\\bin\\QSaharaServer.exe";
	public static final String DEFAULT_FIREHOSELOADER = "C:\\Program Files (x86)\\Qualcomm\\QPST\\bin\\fh_loader.exe";
	
	public Config(String path) {
		mConfigPath = path;
		mConfig = ConfigReader.getConfig(path);
	}
	
	public void put(String key, String value) {
		mConfig.put(key, value);
	}
	
	public String get(String key) {
		return mConfig.get(key);
	}
	
	public void save() {
		ConfigReader.saveConfig(mConfigPath, mConfig);
	}

}
